<template>
  <div>
    <template v-if="list.length == 1">
      <Fields
        :fieldsObj="ri"
        @click="operateDrag(ri)"
        :index="index"
        :nowDrag="nowDrag"
        v-for="(ri, rk) in list"
        :key="rk"
      >
      </Fields>
    </template>
    <template v-else>
      <Fields
        :fieldsObj="ri"
        @click="operateDrag(ri)"
        :showRowOperate="true"
        :index="index"
        :rowIndex="rk"
        :nowDrag="nowDrag"
        v-for="(ri, rk) in list"
        :rowList="list"
        :key="rk"
      >
      </Fields>
    </template>
  </div>
</template>

<script>
import Fields from './Fields.vue'
export default {
  name: 'DrageCenter',
  props: ['list', 'index', 'nowDrag'],
  components: {
    Fields,
  },

  methods: {
    operateDrag (i) {
      this.$emit('click', i)
    },
  },
}
</script>
